#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n;
string text;
set<string> words;
string lower(string s) {
  string t;
  for (char c : s) t.push_back(tolower(c));
  return t;
}
void solve() {
  n = text.size();
  int l = 0;
  while (l < n) {
    if (!isalpha(text[l])) {
      l++;
      continue;
    }
    int h = l + 1;
    while (h < n && isalpha(text[h])) h++;
    words.insert(lower(text.substr(l, h - l)));
    l = h;
  }
  for (string w : words) cout << w << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  char c;
  while ((c = getchar()) != EOF) text.push_back(c);
  solve();
  return 0;
}